<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<fmt:setBundle basename="messages" />
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="PAGE_REGISTER" /></title>
<link rel="stylesheet" type="text/css" href="css/mainStyle.css" />
</head>
<body onload="history.pushState(null, null, 'action?command=register')">
	<jsp:include page="header.jsp" />
	<div id="registerForm">
		<form action="action?command=save" method="post">
			<input type="hidden" name="command" value="save" /> <br> <input
				type="text" name="login"
				placeholder="<fmt:message key="INPUT_LOGIN"/>" required
				pattern="^[а-яА-ЯёЁa-zA-Z0-9]+$"> <br> <input
				type="password" name="password"
				placeholder="<fmt:message key="INPUT_PASSWORD"/>" required /> <br>
			<input type="text" name="name"
				placeholder="<fmt:message key="INPUT_NAME" />" required
				pattern="[A-Z][a-z]+\s[A-Z][a-z]+|[А-Я][а-я]+\s[А-Я][а-я]+" /><br>
			<input type="submit" value="<fmt:message key="BUTTON_REGISTER"/>"
				id="registerButton" />
		</form>

		<div id="errorMessage">
			<c:if test="${not empty errorMessage}">
				<fmt:message key="${errorMessage}" />
			</c:if>
		</div>
		<div id="backButton">
		<h3>
			<a href="index.jsp"><fmt:message key="BUTTON_BACK" /></a>
		</h3>
	</div>
	</div>

	<jsp:include page="footer.jsp" />
</body>
</html>